The XML snippet below is an example payload of the SNX message or the WebService that invokes the above code:
<groovy class-location="database" class-name="StuffAutomobile">
<parameters>
<parameter id="equipment-id" value="MATU6600011"/>
<parameter id="routing-carrier-mode" value="VESSEL"/>
<parameter id="routing-carrier-id" value="RJP051"/>
<parameter id="routing-destination" value="CHI"/>
<parameter id="routing-pod-1" value="LAX"/>
<parameter id="freight-kind" value="FCL"/>
<parameter id="routing-pol" value="HON"/>
<parameter id="position-slot" value="YYAA.1"/>
<parameter id="seal-1" value="SEAL00001"/>
<parameter id="consignee-id" value="xx"/>
<parameter id="consignee-name" value="xx"/>
<parameter id="shipper-id" value="xx"/>
<parameter id="shipper-name" value="xx"/>
<parameter id="commodity-id" value="AUTO"/>
<parameter id="remark" value="Stuffed"/>
<parameter id="recorder" value="JJS"/>
</parameters>
</groovy>
The class-name attribute specifies the name of the Groovy class to be executed.
The class-location attribute tells the system where to find the code defining the Groovy class to be executed. The options are:
database - the code should be retrieved from the N4 database. This would be the normal situation in production use. (More on this below.)
classpath - the code is in a file in the classpath. The class-directory attribute should specify the path to the file within the class path, e.g. "testclasses/groovy"
file - the code is found in the file system. The class-directory attribute should specify the full path to the groovy source file.